<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="author" content="挥手の骑士">
    
    
    
    
    
    
    <title>Telnet 与 SSH | 骑士の物语</title>
    <link href="https://yihuishou.gitee.io" rel="prefetch">

    <link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/aos.js"></script>
    <script src="/js/highslide/highslide-full.min.js"></script>
    <link rel="stylesheet" href="/js/highslide/highslide.css">
    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.gif');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/avatar.jpg'
        var previews = 'picHD_1.png,picHD_2.png,picHD_3.png,picHD_4.png,picHD_5.png,picHD_6.png,picHD_7.png,picHD_8.png,picHD_9.png,picHD_10.png,picHD_11.png,picHD_12.png,picHD_13.png,picHD_14.png,picHD_15.png,picHD_16.png,picHD_17.png,picHD_18.png,picHD_19.png,picHD_20.png,picHD_21.png,picHD_22.png,picHD_23.png,picHD_24.png,picHD_25.png,picHD_26.png,picHD_27.png,picHD_28.png,picHD_29.png,picHD_30.png,picHD_31.png,picHD_32.png,picHD_33.png,picHD_34.png,picHD_35.png,picHD_36.png,picHD_37.png,picHD_38.png,picHD_39.png,picHD_40.png,picHD_41.png,picHD_42.png'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->
</head></html>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>我为</span></li>
        <li><span>长者</span></li>
        <li><span>续一秒</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="https://yihuishou.gitee.io">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">骑士の物语</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="https://yihuishou.gitee.io">骑士の物语</a>
        >
        <span>Telnet 与 SSH</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2019/09/27/2553549325/">Telnet 与 SSH</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-tags"></i>
                
                <a href="/tags/随笔/">随笔</a>
                
            </span>
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2019-09-27
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2019/09/27/2553549325/">Telnet 与 SSH</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2019-09-27
            </p>
            <p>
                
                <i class="fa fa-tags"></i>
                
                <a href="/tags/随笔/">随笔</a>
                
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <p>ssh与telnet的相同点：</p>
<p>1.两种协议都可以远程登录另一台主机</p>
<p>2.两种协议都属于基于TCP/IP的协议</p>
<p>ssh与telnet的不同点：</p>
<p>1.telnet是明文传送；ssh是加密传送，并且支持压缩。</p>
<p>2.telnet的默认端口号为23；ssh的默认端口号为22</p>
<p>3.ssh使用公钥对访问的服务器的用户验证身份，进一步提高的安全性；telnet没有使用公钥。</p>
<p>SSH 生成和使用方法</p>
<ol>
<li>生成SSH密钥</li>
</ol>
<p>命令行执行 ssh-keygen</p>
<p><code>等同于ssh-keygen -t rsa 命令</code></p>
<p>开始生成RSA密钥</p>
<p>ssh-keygen 后可配置一个参数作为提交的 comment</p>
<p>comment 对身份验证本身没有任何影响</p>
<p>之后命令行会询问密钥文件的保存路径，回车使用默认保存路径</p>
<p>最后会询问加密用的私钥，回车使用空口令</p>
<p><code>如果配置的私钥则需要输入两次已验证私钥是否正确</code></p>
<p>通常会在默认保存路径下生成两个密钥文件</p>
<p>id_rsa 私钥文件和 id_rsa.pub 公钥文件</p>
<ol start="2">
<li>服务的配置公钥</li>
</ol>
<p>id_rsa.pub 可用文本工具打开，将公钥明文复制到服务端即可</p>
<p>Github 中在 Setting –&gt; SSH and GPG keys –&gt; New SHH key</p>
<p>将公钥明文粘贴到输入面板中保存</p>
<p>之后Github会询问账户的登录密码，密码验证成功之后 SSH 登录就配置成功了</p>
<p>下一次登录即可直接使用SSH免密登录，如果配置了私钥则在首次登录时需要输入私钥</p>
<ol start="3">
<li>关于IDEA的密码管理</li>
</ol>
<p>idea 默认会记录一些账户密码，如git的用户名和密码，该设置是Configure a password policy</p>
<p>Configure a password policy(配置密码策略)</p>
<p>在“Settings” 对话框（Ctrl+Alt+S）中，选择“ Appearance and Behavior –&gt; System Settings –&gt; Passwords”。</p>
<p>设置IntelliJ IDEA如何处理Git远程存储库的密码:</p>
<p>In native Keychain: 选择此选项以使用本机Keychain存储您的密码。此设置仅适用于MacOS和Linux。</p>
<p>In KeePass: 选择此选项以使用KeePass密码管理器来存储您的密码。使用KeePass密码管理器时，将使用主密码来访问存储个人密码的文件。</p>
<p>一旦IntelliJ IDEA记住您的密码，除非您需要访问密码数据库，否则它不会要求它们。</p>
<p>输入将c.kdbx在MasterPassword字段中用于访问该文件的密码。</p>
<p>您可以在“ 数据库”选项中更改c.kdbx文件的默认位置。</p>
<p>要导入c.kdbx文件，请单击“设置图标”并从下拉菜单中选择“import”，或单击“省略号图标”并指定包含密码的本地文件的路径。</p>
<p>如果要从数据库中删除现有密码，请选择“clear”。</p>
<p>Do not save, forget passwords after restart: 如果要在关闭IntelliJ IDEA后重置密码，请选择此选项。</p>
<p>Set passwords for Git remotes(设置Git远程仓库的密码)</p>
<p>每次与Git远程仓库交互时（例如，在pull， update或push操作期间），都需要授权。您可以配置IntelliJ IDEA</p>
<p>以记住您的密码，这样您就不必在每次需要授权时都指定凭据。身份验证的类型取决于您尝试访问的远程存储库使用的网络协议：HTTP或SSH。</p>
<p>如果您使用HTTP访问远程，当您需要身份验证时，会从GIt凭据助手中请求凭据。如果未找到Git凭证助手，则会向IDE返回提示。</p>
<p>如果已配置密码策略，IntelliJ IDEA将在密码数据库中查找凭据。如果密码数据库中没有，则会提示您输入登录名和密码。</p>
<p>如果您的远程使用SSH协议，则除了配置密码策略外，您还可以选择是使用native（本机）还是built-in（内置） SSH可执行文件。</p>
<p>在Settings –&gt; Preferences对话框（Ctrl+Alt+S）中，选择Version Control –&gt; Git。从SSH可执行文件下拉列表中，选择以下选项之一：</p>
<p>Built-in: 所有授权都在IDE端执行。</p>
<p>如果使用登录名和密码进行身份验证，则会根据所选密码策略执行授权。</p>
<p>如果使用没有密码的SSH密钥进行身份验证，IntelliJ IDEA将访问~/.ssh/config文件并从那里获取密钥。</p>
<p>如果身份验证需要带密码的SSH密钥，会在GIt凭据助手中查找它，如果找不到Git凭证助手，它会向IDE返回提示。</p>
<p>如果已配置 密码策略，IntelliJ IDEA将在密码数据库中查找凭据。如果没有密码数据库，则会显示提示，您必须输入SSH密钥和密码。</p>
<p>Native: 所有授权都在Git端执行。将不显示任何提示，因此如果您使用不带密码的SSH，或者密码保存在凭证帮助程序中，或者有SSH代理，请选择此授权类型。</p>

    </div>
</article>


                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~" autocomplete="off">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            挥手の骑士
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/avatar.jpg" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"></p>
        </div>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/18/55226946/">agent v3.2.1 插件激活码</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/22/2412014068/">干掉 CMS 未来属于 ZGC</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/21/4075219928/">OpenJDK 和 OracleJDK 的抉择</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/20/368594680/">Flutter 音乐播放器开发之路（一）</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/15/3650854255/">XaaS 到底是什么？</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/15/4036766117/">让 Windows 10 开机自动登录</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/14/466733536/">给 Flutter 项目初始化构建提个速</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/12/4125727764/">JavaScript 中 Splice 函数与数组塌陷</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/12/1586694155/">在 Java 中缩写 Lambda 表达式</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/04/2276828982/">博客文章规范</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/06/05/3668064671/">Dart 2.3 踩坑集锦</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/03/05/928293067/">IDEA 导出 Jar 包执行报错</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/01/09/2697897267/">Java 8 中的模板字符串</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/21/4075219928/">OpenJDK 和 OracleJDK 的抉择</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/05/24/1333242850/">RESTFUL API 中的那些事</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2019/04/04/1754077512/">SpringSecurity 前后分离的选择</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/05/22/1391388246/">TeamViewer 在局域网中使用的方法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2018/05/15/1954507039/">WinRar 常用自解压路径及命令</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2017/11/10/2230869343/">我喜欢的排序算法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2017/12/22/3001741591/">用文件特征码来检测文件类型</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">

                
                <li>
                    <a href="/2019/09/27/2553549325/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                
                
                <li>
                    <a href="/2019/09/27/2553549325/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                
                
                <li>
                    <a href="/2019/09/27/2553549325/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
                
            </ul>
            <div class="tab-content">
                
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/SpringSecurity/" style="font-size: 12.033702631876853px;" class="tag-cloud-link">SpringSecurity</a>
    
    <a href="/tags/Xml/" style="font-size: 18.715984961225857px;" class="tag-cloud-link">Xml</a>
    
    <a href="/tags/随笔/" style="font-size: 11.434610820327293px;" class="tag-cloud-link">随笔</a>
    
    <a href="/tags/大前端/" style="font-size: 10.787956125970506px;" class="tag-cloud-link">大前端</a>
    
    <a href="/tags/Dart/" style="font-size: 12.013684970945022px;" class="tag-cloud-link">Dart</a>
    
    <a href="/tags/Flutter/" style="font-size: 14.289393773076807px;" class="tag-cloud-link">Flutter</a>
    
    <a href="/tags/Go/" style="font-size: 13.93507291228347px;" class="tag-cloud-link">Go</a>
    
    <a href="/tags/IDEA/" style="font-size: 18.72777191782253px;" class="tag-cloud-link">IDEA</a>
    
    <a href="/tags/Java/" style="font-size: 12.277437811855858px;" class="tag-cloud-link">Java</a>
    
    <a href="/tags/JavaScript/" style="font-size: 8.179065325997989px;" class="tag-cloud-link">JavaScript</a>
    
    <a href="/tags/Mysql/" style="font-size: 18.40790156234883px;" class="tag-cloud-link">Mysql</a>
    
    <a href="/tags/Oracle/" style="font-size: 11.275671855860558px;" class="tag-cloud-link">Oracle</a>
    
    <a href="/tags/Photoshop/" style="font-size: 19.974421586533403px;" class="tag-cloud-link">Photoshop</a>
    
    <a href="/tags/RPG-Maker-MV/" style="font-size: 18.358587360551404px;" class="tag-cloud-link">RPG Maker MV</a>
    
    <a href="/tags/Restful/" style="font-size: 19.650910647638874px;" class="tag-cloud-link">Restful</a>
    
    <a href="/tags/Redis/" style="font-size: 13.829765335607686px;" class="tag-cloud-link">Redis</a>
    
    <a href="/tags/SQL/" style="font-size: 11.057240161587995px;" class="tag-cloud-link">SQL</a>
    
    <a href="/tags/SpringBoot/" style="font-size: 17.28605935435659px;" class="tag-cloud-link">SpringBoot</a>
    
    <a href="/tags/Swagger/" style="font-size: 15.533138019521308px;" class="tag-cloud-link">Swagger</a>
    
    <a href="/tags/Windows/" style="font-size: 14.421332737391175px;" class="tag-cloud-link">Windows</a>
    
    <a href="/tags/Deepleanring/" style="font-size: 14.92001447777297px;" class="tag-cloud-link">Deepleanring</a>
    
    <a href="/tags/Vue/" style="font-size: 11.522943946412639px;" class="tag-cloud-link">Vue</a>
    
    <a href="/tags/Docker/" style="font-size: 19.086773209350717px;" class="tag-cloud-link">Docker</a>
    
    <a href="/tags/Hexo/" style="font-size: 11.657824868357489px;" class="tag-cloud-link">Hexo</a>
    
    <a href="/tags/VsCode/" style="font-size: 9.158845511481069px;" class="tag-cloud-link">VsCode</a>
    
    <a href="/tags/SpringCloud/" style="font-size: 11.606888917784925px;" class="tag-cloud-link">SpringCloud</a>
    
</div>
                
                
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="http://noodlefighter.com" target="_blank">虾包</a>
    </li>
    
    <li>
        <a href="https://loli.la" target="_blank">超级叫了</a>
    </li>
    
    <li>
        <a href="https://konata9.github.io" target="_blank">吃土的小此方</a>
    </li>
    
</div>
                
                
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/yihuishou" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="https://gite.com/yihuishou" target="_blank">码云</a>
    </li>
    
    <li>
        <a href="https://www.zhihu.com/people/hei-yi-tian-shi-48" target="_blank">知乎</a>
    </li>
    
</div>
                
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 挥手の骑士 Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;Theme by <a href="https://github.com/ZEROKISEKI" target="_blank">AONOSORA</a>
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop">
    <i class="fa fa-angle-up"></i>
</div>
</body>
<script src="/js/activate-power-mode.js"></script>
<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>
<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>



</html>